/*
 * SAXParseException.hpp
 *
 *  Created on: Dec 8, 2013
 *      Author: paste
 */

#ifndef SAXPARSEEXCEPTION_HPP_
#define SAXPARSEEXCEPTION_HPP_

#include "Locator.hpp"

namespace saxpp
{

  template<class CH = char, class TRAITS = std::char_traits<CH> >
    class SAXParseException : public SAXException<CH, TRAITS>
    {
      typedef CH char_type;
      typedef TRAITS char_traits;
      typedef std::basic_string<char_type, char_traits> string_type;

      SAXParseException(const string_type &message, const Locator &locator) :
          SAXException<char_type, char_traits>(message), myPublicId(
              locator.getPublicId()), mySystemId(locator.getSystemId()), myColumnNumber(
              locator.getColumnNumber()), myLineNumber(locator.getLineNumber())
      {
      }

      SAXParseException(const string_type &message, const string_type &publicId,
          const string_type &systemId, const int &lineNumber,
          const int &columnNumber) :
          SAXException<char_type, char_traits>(message), myPublicId(publicId), mySystemId(
              systemId), myColumnNumber(columnNumber), myLineNumber(lineNumber)
      {
      }

      virtual
      ~SAXParseException()
      {
      }

      int
      getColumnNumber()
      {
        return myColumnNumber;
      }

      int
      getLineNumber()
      {
        return myLineNumber;
      }

      string_type
      getPublicId()
      {
        return myPublicId;
      }

      string_type
      getSystemId()
      {
        return mySystemId;
      }

    protected:

      string_type myPublicId;

      string_type mySystemId;

      int myColumnNumber;

      int myLineNumber;
    };

}

#endif /* SAXPARSEEXCEPTION_HPP_ */
